//
//  GCW_SongMuneCell.m
//  MooMusic
//
//  Created by 管晨雯 on 15/10/22.
//  Copyright © 2015年 wjy. All rights reserved.
//

#import "GCW_SongMuneCell.h"
#import "PrefixHeader.pch"
#import <UIImageView+WebCache.h>
@implementation GCW_SongMuneCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        self.backImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.backImageView];
        
        
        self.moodLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.moodLabel];
        
    }
    
    return self;
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.backImageView.frame = CGRectMake(10 * WIDTH, 10 * HEIGH, 140 * WIDTH, 140 * HEIGH);
//    self.backImageView.backgroundColor = [UIColor brownColor];
    
    
    
    self.moodLabel.frame = CGRectMake(10 * WIDTH, 140 * HEIGH, 140 * WIDTH, 60 * HEIGH);
//    self.moodLabel.backgroundColor = [UIColor blueColor];

    
}


- (void)setSongsMuneModel:(GCW_SongsMuneModel *)songsMuneModel
{
    _songsMuneModel = songsMuneModel;
    
    if (self.songsMuneModel.pic_url != nil) {
        
        [self.backImageView sd_setImageWithURL:[NSURL URLWithString:self.songsMuneModel.pic_url] placeholderImage:[UIImage imageNamed:@"mv_big_cover_default.jpg"]];
    }
    
    
    
    if (self.songsMuneModel.title != nil) {
        
        self.moodLabel.text = self.songsMuneModel.title;
    }
    
}






@end
